package org.aldar.bquest.entity.ui;

import org.aldar.bquest.resources.Texts;
import org.andengine.entity.sprite.ButtonSprite;
import org.andengine.entity.text.Text;
import org.andengine.entity.text.TextOptions;
import org.andengine.opengl.font.Font;
import org.andengine.opengl.texture.region.ITextureRegion;
import org.andengine.opengl.vbo.VertexBufferObjectManager;
import org.andengine.util.adt.align.HorizontalAlign;

/**
 * User: Daria
 * Date: 8/15/14 10:18 PM
 */
public class TextButtonSprite extends ButtonSprite {

    Text buttonText;

    public TextButtonSprite(float x, float y, ITextureRegion textureRegion, ITextureRegion textureRegion1, ITextureRegion textureRegion2, VertexBufferObjectManager vertexBufferObjectManager,
                            ButtonSprite.OnClickListener onClick, Texts text, Font font) {
        super(x, y, textureRegion, textureRegion1, textureRegion2, vertexBufferObjectManager, onClick);
        buttonText = new Text(textureRegion.getWidth() / 2, textureRegion.getHeight() / 2, font, text.getLangText(), 100, new TextOptions(HorizontalAlign.CENTER), vertexBufferObjectManager);
        this.attachChild(buttonText);
    }

    public TextButtonSprite(float x, float y, ITextureRegion textureRegion, ITextureRegion textureRegion1, VertexBufferObjectManager vertexBufferObjectManager,
                            ButtonSprite.OnClickListener onClick, Texts text, Font font) {
        super(x, y, textureRegion, textureRegion1, vertexBufferObjectManager, onClick);
        buttonText = new Text(textureRegion.getWidth() / 2, textureRegion.getHeight() / 2, font, text.getLangText(), 100, new TextOptions(HorizontalAlign.CENTER), vertexBufferObjectManager);
        this.attachChild(buttonText);
    }
}
